
import { Logger } from "./Logger";
// import  CryptoTS from "./crypto-ts";
// var CryptoTS = require("./crypto-ts.js");
var CryptoTS = require("./crypto-ts");
// import  CryptoTS from  "./crypto-ts";


export class CryptoTSHelper {

    private static publicKey: string = '1kieoiwf90-*12zOp+-!afHV';


    public static encrypt(str: string) {
        Logger.log("CryptoTSHelper.encrypt=11=", CryptoTS)
        let encStr = CryptoTS.AES.encrypt(str, this.publicKey).toString()
        Logger.log("CryptoTSHelper.encrypt==", encStr)
        return encStr
    }

    public static decrypt(str: string) {
        var descStr:string = CryptoTS.AES.decrypt(str, this.publicKey).toString(CryptoTS.enc.Utf8);
        Logger.log("CryptoTSHelper.decrypt==2222", descStr)
        return descStr
    }

}